﻿Namespace ViewModel.UISettings

    Public Class DataGridViewModel
        Inherits ViewModelBase

        Private _group As Grouping.ProgramGroup = Grouping.ProgramGroup.None
        Public Property Group() As Grouping.ProgramGroup
            Get
                Return _group
            End Get
            Set(ByVal value As Grouping.ProgramGroup)
                _group = value
                OnPropertyChanged("Group")
            End Set
        End Property

        Private _groupByAlertedProgram As Boolean
        Public Property GroupByAlertedProgram() As Boolean
            Get
                Return _groupByAlertedProgram
            End Get
            Set(ByVal value As Boolean)
                _groupByAlertedProgram = value
                OnPropertyChanged("GroupByAlertedProgram")
            End Set
        End Property

        Private _groupByAlertTarget As Boolean
        Public Property GroupByAlertTarget() As Boolean
            Get
                Return _groupByAlertTarget
            End Get
            Set(ByVal value As Boolean)
                _groupByAlertTarget = value
                OnPropertyChanged("GroupByAlertTarget")
            End Set
        End Property

        Private _groupByOffair As Boolean
        Public Property GroupByOffair() As Boolean
            Get
                Return _groupByOffair
            End Get
            Set(ByVal value As Boolean)
                _groupByOffair = value
                OnPropertyChanged("GroupByOffair")
            End Set
        End Property


#Region "Column Width Properties"

        Private _iconWidth As Double
        Public Property IconWidth() As Double
            Get
                Return _iconWidth
            End Get
            Set(ByVal value As Double)
                _iconWidth = value
                OnPropertyChanged("IconWidth")
            End Set
        End Property

        Private _titleWidth As Integer
        Public Property TitleWidth() As Integer
            Get
                Return _titleWidth
            End Get
            Set(ByVal value As Integer)
                _titleWidth = value
                OnPropertyChanged("TitleWidth")
            End Set
        End Property

        Private _stationNameWidth As Integer
        Public Property StationNameWidth() As Integer
            Get
                Return _stationNameWidth
            End Get
            Set(ByVal value As Integer)
                _stationNameWidth = value
                OnPropertyChanged("StationNameWidth")
            End Set
        End Property

        Private _casterWidth As Integer
        Public Property CasterWidth() As Integer
            Get
                Return _casterWidth
            End Get
            Set(ByVal value As Integer)
                _casterWidth = value
                OnPropertyChanged("CasterWidth")
            End Set
        End Property

        Private _memberOnlyWidth As Integer
        Public Property MemberOnlyWidth() As Integer
            Get
                Return _memberOnlyWidth
            End Get
            Set(ByVal value As Integer)
                _memberOnlyWidth = value
                OnPropertyChanged("MemberOnlyWidth")
            End Set
        End Property

        Private _officialTagWidth As Integer
        Public Property OfficialTagWidth() As Integer
            Get
                Return _officialTagWidth
            End Get
            Set(ByVal value As Integer)
                _officialTagWidth = value
                OnPropertyChanged("OfficialTagWidth")
            End Set
        End Property

        Private _faceWidth As Integer
        Public Property FaceWidth() As Integer
            Get
                Return _faceWidth
            End Get
            Set(ByVal value As Integer)
                _faceWidth = value
                OnPropertyChanged("FaceWidth")
            End Set
        End Property

        Private _commentCountWidth As Integer
        Public Property CommentCountWidth() As Integer
            Get
                Return _commentCountWidth
            End Get
            Set(ByVal value As Integer)
                _commentCountWidth = value
                OnPropertyChanged("CommentCountWidth")
            End Set
        End Property

        Private _visitorCountWidth As Integer
        Public Property VisitorCountWidth() As Integer
            Get
                Return _visitorCountWidth
            End Get
            Set(ByVal value As Integer)
                _visitorCountWidth = value
                OnPropertyChanged("VisitorCountWidth")
            End Set
        End Property

        Private _shortContentWidth As Integer
        Public Property ShortContentWidth() As Integer
            Get
                Return _shortContentWidth
            End Get
            Set(ByVal value As Integer)
                _shortContentWidth = value
                OnPropertyChanged("ShortContentWidth")
            End Set
        End Property




#End Region


#Region "Visible Properties"

        Private _iconVisible As Boolean = True
        Public Property IconVisible() As Boolean
            Get
                Return _iconVisible
            End Get
            Set(ByVal value As Boolean)
                _iconVisible = value
                OnPropertyChanged("IconVisible")
            End Set
        End Property

        Private _titleVisible As Boolean = True
        Public Property TitleVisible() As Boolean
            Get
                Return _titleVisible
            End Get
            Set(ByVal value As Boolean)
                _titleVisible = value
                OnPropertyChanged("TitleVisible")
            End Set
        End Property

        Private _stationVisible As Boolean = True
        Public Property StationNameVisible() As Boolean
            Get
                Return _stationVisible
            End Get
            Set(ByVal value As Boolean)
                _stationVisible = value
                OnPropertyChanged("StationNameVisible")
            End Set
        End Property

        Private _casterVisible As Boolean = True
        Public Property CasterVisible() As Boolean
            Get
                Return _casterVisible
            End Get
            Set(ByVal value As Boolean)
                _casterVisible = value
                OnPropertyChanged("CasterVisible")
            End Set
        End Property

        Private _startDateTimeVisible As Boolean = True
        Public Property StartDateTimeVisible() As Boolean
            Get
                Return _startDateTimeVisible
            End Get
            Set(ByVal value As Boolean)
                _startDateTimeVisible = value
                OnPropertyChanged("StartDateTimeVisible")
            End Set
        End Property

        Private _visitorCountVisible As Boolean = True
        Public Property VisitorCountVisible() As Boolean
            Get
                Return _visitorCountVisible
            End Get
            Set(ByVal value As Boolean)
                _visitorCountVisible = value
                OnPropertyChanged("VisitorCountVisible")
            End Set
        End Property

        Private _commentCountVisible As Boolean = True
        Public Property CommentCountVisible() As Boolean
            Get
                Return _commentCountVisible
            End Get
            Set(ByVal value As Boolean)
                _commentCountVisible = value
                OnPropertyChanged("CommentCountVisible")
            End Set
        End Property

        Private _officialTagVisible As Boolean = True
        Public Property OfficialTagVisible() As Boolean
            Get
                Return _officialTagVisible
            End Get
            Set(ByVal value As Boolean)
                _officialTagVisible = value
                OnPropertyChanged("OfficialTagVisible")
            End Set
        End Property

        Private _contentVisible As Boolean = True
        Public Property ShortContentVisible() As Boolean
            Get
                Return _contentVisible
            End Get
            Set(ByVal value As Boolean)
                _contentVisible = value
                OnPropertyChanged("ShortContentVisible")
            End Set
        End Property

        Private _ratingVisible As Boolean = True
        Public Property RatingVisible() As Boolean
            Get
                Return _ratingVisible
            End Get
            Set(ByVal value As Boolean)
                _ratingVisible = value
                OnPropertyChanged("RatingVisible")
            End Set
        End Property

        Private _alertSettingsVisible As Boolean = True
        Public Property AlertSettingsVisible() As Boolean
            Get
                Return _alertSettingsVisible
            End Get
            Set(ByVal value As Boolean)
                _alertSettingsVisible = value
                OnPropertyChanged("AlertSettingsVisible")
            End Set
        End Property
#End Region

#Region "Commands"
        Private _showAllColumnsCommand As ICommand
        Public ReadOnly Property ShowAllColumnsCommand() As ICommand
            Get
                If _showAllColumnsCommand Is Nothing Then
                    _showAllColumnsCommand = New RelayCommand(New Action(Of Object)(AddressOf Me.ShowAllColumns))
                End If
                Return _showAllColumnsCommand
            End Get
        End Property

        Private Sub ShowAllColumns(ByVal obj As Object)
            IconVisible = True
            TitleVisible = True
            CasterVisible = True
        End Sub


        Public Event RequestSetGroup As EventHandler(Of GroupEventArgs)
        Protected Overridable Sub OnSetGroup(ByVal e As GroupEventArgs)
            RaiseEvent RequestSetGroup(Me, e)
        End Sub

        Private _setGroupCommand As ICommand
        Public ReadOnly Property SetGroupCommand() As ICommand
            Get
                If _setGroupCommand Is Nothing Then
                    _setGroupCommand = New RelayCommand(New Action(Of Object)(AddressOf Me.SetGroup))
                End If
                Return _setGroupCommand
            End Get
        End Property

        Private Sub SetGroup(ByVal obj As Object)
            Dim value = [Enum].Parse(GetType(Grouping.ProgramGroup), CStr(obj))
            Group = DirectCast(value, Grouping.ProgramGroup)
            OnSetGroup(New GroupEventArgs(Group))
        End Sub
#End Region

    End Class

End Namespace
